package com.uzai.common.enums;

/**
 * 风险类型
 * @Auther: liuqi
 * @Date: 2021/8/14 16:45
 * @Description:
 */
public enum RiskTypeEnum {
    TAKE_BAL(501,"提现","RISK_TAKE_BAL","manyUserTakeBalLarge"),
    ORDER(500,"订单","RISK_ORDER","manyOrderCommissionLarge");

    private Integer id;
    private String desc;
    private String topic;
    private String key;

    public static final int TAKE_BAL_VALUE = 501;
    public static final int ORDER_VALUE = 500;

    RiskTypeEnum(Integer id, String desc,String topic,String key) {
        this.id = id;
        this.desc = desc;
        this.topic = topic;
        this.key = key;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public static RiskTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (RiskTypeEnum type: RiskTypeEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
